package com.ozo.easy.gen.constant;

import com.ozo.easy.common.constant.BaseEnum;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 数据类型枚举
 *
 * @author ozo
 * @date 2025-01-06
 */
@Getter
@RequiredArgsConstructor
public enum MySQLColumnType implements BaseEnum {

    CHAR("char", JavaType.STRING, HtmlType.INPUT),

    VARCHAR("varchar", JavaType.STRING, HtmlType.INPUT),

    TEXT("text", JavaType.STRING, HtmlType.TEXTAREA),

    BLOB("blob", JavaType.INPUT_STREAM, HtmlType.UPLOAD),

    TINYINT("tinyint", JavaType.BYTE, HtmlType.INPUT_NUMBER),

    TINYINT1("tinyint(1)", JavaType.BOOLEAN, HtmlType.SWITCH),

    BOOLEAN("boolean", JavaType.BOOLEAN, HtmlType.SWITCH),

    SMALLINT("smallint", JavaType.SHORT, HtmlType.INPUT_NUMBER),

    MEDIUMINT("mediumint", JavaType.INTEGER, HtmlType.INPUT_NUMBER),

    INT("int", JavaType.INTEGER, HtmlType.INPUT_NUMBER),

    BIGINT("bigint", JavaType.LONG, HtmlType.INPUT_NUMBER),

    FLOAT("float", JavaType.FLOAT, HtmlType.INPUT),

    DOUBLE("double", JavaType.DOUBLE, HtmlType.INPUT),

    DECIMAL("decimal", JavaType.BIG_DECIMAL, HtmlType.INPUT),

    DATE("date", JavaType.LOCAL_DATE, HtmlType.DATE),

    DATETIME("datetime", JavaType.LOCAL_DATETIME, HtmlType.DATETIME),

    TIMESTAMP("timestamp", JavaType.LOCAL_DATETIME, HtmlType.DATETIME),

    TIME("time", JavaType.LOCAL_TIME, HtmlType.TIME),

    YEAR("year", JavaType.INTEGER, HtmlType.YEAR),
    ;

    /**
     * 描述
     */
    private final String desc;

    /**
     * java类型
     */
    private final JavaType javaType;

    /**
     * html类型
     */
    private final HtmlType htmlType;

}